

// MILC v5 gauge
// -------------
typedef struct {
  type32 magic_number;
  char   timestamp[SIZE];
  type32 dim[4];
  type32 order;
} MILC_v5_gauge_header;


// MILC v5 Wilson quark
typedef struct {
  type32 magic_number;
  char   timestamp[SIZE];
  type32 dim[4];
  type32 order;
  type32 n_src_spins;
  type32 src_spin_list[4]; ?
} MILC_v5_wquark_header;

// Common to gauge and wilson quarks
typedef struct {
  type32 site_natural_order[];
} MILC_v5_site_list;

// Only in MILC gauge files?
typedef struct {
  type32 word[2]; ???
} MILC_v5_checksum;


// All data written in each system's natural endian order

// Unified
typedef struct {
  type32 magic_number;
  char   timestamp[4*SIZE];
  type32 sizeof_element;
  type32 elements_per_site;
  type32 dim[4];
  type32 order;
} UNI_header;

// Followed by optional site-list
typedef struct {
  type32 site_natural_order[];
} UNI_site_list;

// Each record's data is preceeded by a checksum
typedef struct {
  type32 word[2];
} UNI_checksum;

// Followed by
//    size = sizeof_element * elements_per_site *
//                            dim[0] * dim[1] * dim[2] * dim[3]
// bytes of data

// all other meta-data belongs in the .info file


// canopy

write_header

get_site_list

write_data

